// JavaScript Document
// alert(getNameWzExt("c:\\fff\\t.txt"));
function addSuffix(f,suffix)
{ var path = require('path');
    var outputDir=getDir(f);
    var outputFile=getNameNoExt(f)+suffix+"."+getExt(f);
    var outFull=outputDir+path.sep+outputFile;
    return outFull;
}
function getExt(fpath)

{
   fpath=getNameWzExt(fpath);
    var idx=	fpath.lastIndexOf(".");

    return fpath.substr(idx+1);

}
function main()
{
var s="C:\\debug\\node.js"
    console.log("--tr line:"+getNameNoExt(s));
}
//main();
function getNameNoExt(fpath)

{
    fpath=getNameWzExt(fpath);
    var idx=	fpath.lastIndexOf(".");

    return fpath.substr(0,idx);

}

function delExtName(f)
{
    var dir=getDirV2(f);
    var path = require('path');
    var name_noExt=getNameNoExt(f);
    return dir+path.sep+name_noExt;

}



function getNameWzExt(fpath)

{
	//fpath=fpath.replace("\\\\","\\/");
 //	alert(fpath);
    var path = require('path');
var idx=	fpath.lastIndexOf(path.sep);

return fpath.substr(idx+1);
	
}

function getDir(filePath)
{
    var path = require('path');

    var dir=filePath.substring(0,filePath.lastIndexOf(path.sep)+1);
    return dir;
}

function getDirV2(filePath)
{
    var path = require('path');

    var dir=filePath.substring(0,filePath.lastIndexOf(path.sep));
    return dir;
}
function getDir_test()
{

}

try{
    exports.addSuffix = addSuffix;

    exports.getDir = getDir;
    exports.getDirV2 = getDirV2;
    exports.getExt = getExt;
    exports.getNameNoExt = getNameNoExt;
    //////333rrrddeeeee333eee

    exports.getNameWzExt = getNameWzExt;
    exports.delExtName = delExtName;

}catch(e)
{

}